import React, {Component} from 'react';
import PropTypes from 'prop-types';

class MainBanner extends Component {

    static defaultProps={
        data:"默认值"
    }
    constructor(props) {
        console.log(props);
        super(props);
    }

    render() {
        return (
            <div>
                <h2>MainBanner</h2>
                <h2>{this.props.data}</h2>
            </div>
        );
    }
}

MainBanner.propTypes = {
    data: PropTypes.string
}
MainBanner. defaultProps={
    data:"默认值2"
}

export default MainBanner;